package com.yan.demo.arrydemo;

import java.util.Arrays;
import java.util.Random;

public class ArrayTest13 {
    public static void main(String[] args) {
        int[] arr = new int[5];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new Random().nextInt(101);
        }
        boolean flag = false;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] < 10){
                System.out.print(arr[i] + " ");
                flag = true;
            }
        }
        if(flag == false){
            System.err.println("未找到合适数据！");
        }
        // System.out.println(Arrays.toString(arr));
    }
}
